﻿using System;
using System.Configuration;
using System.IO;
using Fuse8.DomainFramework.Practices.Domain.Interfaces;

namespace UnitTests
{
	public class ConnectionStringFactory : IConnectionStringFactory
	{
		public string GetConnectionString<T>()
		{
			if(ConfigurationManager.ConnectionStrings["DB"] != null)
			{
			    return ConfigurationManager.ConnectionStrings["DB"].ConnectionString;
			}
            return string.Format(@"Data Source=.;AttachDbFilename={0};Initial Catalog=DfpTest;Integrated Security=True", 
				Path.Combine(Environment.CurrentDirectory, @"DB\Fuse8_Dfp_Test_Dz.mdf"));
		}
	}
}